import java.util.Scanner;

public class AbnormalLogin {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        System.out.println("请输入用户名和密码：");
        String name = scan.next();
        String password = scan.next();

        try {
            login(name, password);
        } catch (LoginException e) {
            e.printStackTrace();
        }

        System.out.println("你可以再次尝试");
    }

    public static void login(String name, String password) throws LoginException{
            if (!name.equals("嘻嘻")) {
                throw new LoginException("用户名错误");
            }

            if (!password.equals("13579")) {
                throw new LoginException("密码错误");
            }

            System.out.println("密码正确");
    }
}
